//
//  DDAvatarPickerView.m
//  DingDongZP
//
//  Created by Ray on 16/4/11.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDAvatarPickerView.h"

@implementation DDAvatarPickerView

- (void)awakeFromNib
{
    self.floatShow = YES;
    self.popDirection = CCPopoverFromBottom;
    self.width = [UIScreen mainScreen].bounds.size.width;
    _showDefaultsImgs = YES;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    if (!_showDefaultsImgs) {
        _selectDefaultBtn.hidden = YES;
        _selectDefaulLab.hidden = YES;
        
        _takePhotoBtn.centerX = self.width / 4;
        _takePhotoLab.centerX = self.width / 4;
        _albumBtn.centerX = self.width / 4.0 * 3;
        _albumLab.centerX = self.width / 4.0 * 3;
    }
}

- (IBAction)btnAction:(UIButton *)sender
{
    [self dismissWithAnimation:YES];
    
    if (self.didSelectAvatarType) {
        self.didSelectAvatarType(sender.tag);
    }
}
- (IBAction)backs:(id)sender {
    
    [self dismissWithAnimation:YES];
    [self removeFromSuperview];
}

@end
